package metric

import (
	"gddgame.cc/galaxy/binocle"
	"github.com/toolkits/nux"
)

func Sock(agent binocle.Service) error {
	if _, err := nux.SocketStatSummary(); err != nil {
		return err
	}

	agent.AddMetrics().Collect(func() map[string]float32 {
		ssMap, _ := nux.SocketStatSummary()
		collects := map[string]float32{}
		for k, v := range ssMap {
			collects["ss."+k] = float32(v)
		}
		return collects
	})

	return nil
}
